import * as api from '../../util/api';
import http from '../../util/http';

const state ={
    PromotionDada:[],
};

const actions={
    DataGetPromotion({commit}){          //促销商品
        return http({
            url:api.DataGetPromotion,
            method:'post',
        }).then(res=>{
            commit('getPromotion',res.data.data)
            // console.log(res.data.data)
            return res.data.data //将数据返回给页面，处理异步
        })
    }
}


const mutations={
    getPromotion(state,obj){
        state.PromotionDada = obj
    },
}

export default {
    state,
    actions,
    mutations
}